package com.example.xlzx.controller;

import com.example.xlzx.entity.vo.CozeVo;
import com.example.xlzx.result.Result;
import com.example.xlzx.service.CozeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
@Tag(name = "心理测评")
@RestController
@RequestMapping("/xlzx")
public class CozeAi {
    @Autowired
    private CozeService cozeService;

    @Operation(summary = "coze智能体")
    @PostMapping(value = "/coze/chat")
    public Result<String> chat(@RequestBody CozeVo cozeVo) {
        // 调用 CozeService 并返回生成的聊天内容
        return Result.ok(cozeService.generateResponse(cozeVo));
    }
}
